#ifndef YSHIFTSETTING_H
#define YSHIFTSETTING_H

#include <QDialog>
#include "qcustomplot/qcustomplot.h"

namespace Ui {
class YShiftSetting;
}

struct Shift {
    bool valid{false};
    double offset{0};
    double step{0};
    QVector<double> origin;
};

class YShiftSetting : public QDialog
{
    Q_OBJECT

public:
    explicit YShiftSetting(QWidget *parent = nullptr);
    ~YShiftSetting();

    void setOption(Shift &shift, QCustomPlot *plot, QVector<double> *origin);
    QPair<double, double> getOption();

    static void shiftData(QCustomPlot *plot, QVector<double> *origin, double offset);
private slots:
//    void on_spinOffset_valueChanged(double arg1);

    void on_btnDefault_clicked();

private:
    Ui::YShiftSetting *ui;
    QVector<double> *mOrigin;
    QCustomPlot *mPlot{nullptr};
};

#endif // YSHIFTSETTING_H
